import { appConfig } from '@/config/app';

export const localStorage = {
  setToken: (s) => {
    uni.setStorageSync(appConfig.tokenKey, s);
  },
  getToken: () => {
    return uni.getStorageSync(appConfig.tokenKey);
  },
  clearToken: () => {
    uni.removeStorageSync(appConfig.tokenKey);
  },
  setLocalVersion: (s) => {
    uni.setStorageSync(appConfig.localVersionKey, s);
  },
  getLocalVersion: () => {
    return uni.getStorageSync(appConfig.localVersionKey);
  },
  clearLocalVersion: () => {
    uni.removeStorageSync(appConfig.localVersionKey);
  },
  setAppKey: s => {
    uni.setStorageSync(appConfig.appKey, s);
  },
  getAppKey: () => {
    return uni.getStorageSync(appConfig.appKey);
  }
};
